<include file="Public:header" />
<link rel="stylesheet" type="text/css" href="../Public/css/pic_tushu.css"/>
<link href="../Public/css/downappear.css" rel="stylesheet" type="text/css" />
<script src="../Public/js/calendar.js" type='text/javascript' language="javascript"></script>
<script type="text/javascript">

$(function(){
	$("#wordul li").find('a').click(function(){
		$("#category").val(7);
		$("#search_keyword").val($(this).text());
		$("#form1").attr("action","{:U('Search/more')}");
		$("#form1").submit();
	});	
})

</script>
<div class="inner-content">
<div class="crumbs">当前位置：<a href="#">图书</a></div>
<div class="w_content">
<div class="content_l">
<div class="sidenav">
<h3>图书分类</h3>
<ul>
<volist id="ca" name="cate">
<li>
<dl>
<dt><a href="{:U('Book/index',array('cateid'=>$ca['cateid'],'erji'=>1))}">{$ca.catename}</a></dt>
<dd><volist id="cas" name="ca.smcate">
<a href="{:U('Book/index',array('cateid'=>$cas['cateid']))}">{$cas.catename}</a>
</volist>
</dd>
</dl>
</li>
</volist>

</ul>
</div>
<div class="rank">
<h3>热搜词排行</h3>
<ul id="wordul">
<li class="rankli"><span>排 名</span><span>关键字</span><span>趋 势</span></li>
<empty name="searlist">
	<p style="text-align:center; font-size:14px;">暂无热搜词</p>
<else />
<volist id="rkli" name="searlist" key="k" >
<li><span class="num">{$k}</span><span class="word"><a href="javascript:void(0);">{$rkli.keyword}</a></span><span class="rank_img">
<eq name="rkli.type" value="1">
<img src="../Public/images/red.jpg" />
<else/>
<img src="../Public/images/green.jpg" />
</eq>
</span></li>
</volist>
</empty>
</ul>
</div>
</div>
<div class="content_r">
<div class="content_r_top">
  <div class="left_ranking">
    <dl>
      <dt>
        <span>年度排行</span>
     
      </dt>
      <volist id="vo" name="plist" key="i">
      <dd>
        <span class="number">{$i}</span>
        <span><if condition="$vo.imageurl eq ''" >
        			<a href="{:U('Book/info',array('vid'=>$vo['bid']))}"><img src="__PUBLIC__/Images/no_img.jpg" width="49" height="58"/></a>
        		<else />
        			<a href="{:U('Book/info',array('vid'=>$vo['bid']))}"><img src="__PUBLIC__/Uploads/Book/Image/m_{$vo.imageurl}" width="49" height="58" /></a>
        	  </if>
        </span>
        <span>
          <div class="booksName"><a href="{:U('Book/info',array('vid'=>$vo['bid']))}">{$vo.title|msubstr=###,0,8}</a></div>
          <div class="booksDown">下载次数：{$vo.point}</div>
        </span>
      </dd>
      </volist>
      
    </dl>
    <div class="clear"></div>
  </div>
  <div class="right_newbooks">
    <div class="title">
      <span>新书快递</span>
     <!--   <img src="../Public/images/more_hot.gif" width="70" height="21" /> -->
    </div>
    <?php if($hot['title']){ ?>
    <div class="detail">
      <a href="{:U('Book/info',array('vid'=>$hot['bid']))}"><img class="img" src="__PUBLIC__/Uploads/Book/Image/m_{$hot.imageurl}" width="146" height="178" /></a>
      <h3><a href="{:U('Book/info',array('vid'=>$hot['bid']))}">{$hot.title}</a></h3>
      <p>
      	{$hot.desc|msubstr=###,0,60}
      </p>
      <div class="btnC">
      <if condition="$hot neq ''">
        <eq name='is_login' value='1'>
    	<li><img src="../Public/images/download_btn.jpg" alt="" title="" id='but' onclick="point({$hot['downscore']},{$prescore})"></li>
        <img src="../Public/images/favorite_btn.gif" width="97" height="37" onclick="favorite();"/>
         <else/>
        <li><img src="../Public/images/download_btn.jpg" alt="" title="" id='but_no'></li>
        <img src="../Public/images/favorite_btn.gif" width="97" height="37" id="no_login"/>
        </eq>
      </if>
      </div>
    </div>
    <?php } ?>
    <div class="recommendBooks">
      <ul>
      <volist id="fl" name="flist">
        <li>
	        <if condition="$fl.imageurl eq ''" >
				<a href="{:U('Book/info',array('vid'=>$fl['bid']))}"><img src="__PUBLIC__/Images/no_img.jpg" width="90" height="101"/></a>
				<p class="text">{$fl.title}</p>
			    <p class="bg"></p>
			<else /> 
				<a href="{:U('Book/info',array('vid'=>$fl['bid']))}"><img src="__PUBLIC__/Uploads/Book/Image/m_{$fl.imageurl}" width="90" height="101" /></a>
		        <p class="text">{$fl.title}</p>
		        <p class="bg"></p>
			 </if>
        </li>
      </volist>
        
      </ul>
    </div>
  </div>
<div class="clear"></div>
<form action="{:U('Book/index')}" method="post">
<div class="retrieval" style="height:150px">
<p>上传时间：<input id="stime1" type="radio" name="stime" class="r_btn"  onclick="showctime();" value="1" <empty name="choose.stime">checked='checked'</empty> <if condition="$choose.stime eq 1">checked='checked'</if>  />选择时间
<input id="stime2" type="radio" class="r_btn" name="stime" onclick="closectime();" value="2"  <if condition="$choose.stime eq 2">checked='checked'</if> />
快捷时间段
<select id="ftime" name="ftime" onclick="select_fast_time()">
<option id="ftime_defalut" value="1" <if condition="$choose.ftime eq 1">selected='selected'</if>>全部</option>
<option value="2" <if condition="$choose.ftime eq 2">selected='selected'</if>>最近一天</option>
<option value="3" <if condition="$choose.ftime eq 3">selected='selected'</if>>最近两天</option>
<option value="4" <if condition="$choose.ftime eq 4">selected='selected'</if>>最近一周</option>
<option value="5" <if condition="$choose.ftime eq 5">selected='selected'</if>>最近半月</option>
</select>
<span style="margin-left:5px">最近检索词：</span>
<select id="zkeyword" name="zkeyword" onchange="change_keyword()">
<option id="zkeyword_defalut" value="">无</option>
<volist id="zk" name="zkeywords">
<option value="{$zk}">{$zk}</option>
</volist>
</select>
</p>
<p class="ymd" id="ctime" <if condition="$choose.stime eq 2"> style="display:none" </if> >
开始时间:<input name="btime" type="text" style="width:100px" id="btime" maxlength="18" onfocus="c.showMoreDay = false;c.show(this);" value="{$choose.btime}" readonly="readonly"/>--
结束时间:<input name="etime" type="text" style="width:100px" id="etime" maxlength="18" onfocus="c.showMoreDay = false;c.show(this);" value="{$choose.etime}" readonly="readonly"/>
</p>
<p><span >检索词：</span>
<input type="text" id="keyword1" name="keyword1" value="{$choose.keyword1}" <if condition="$choose.bything eq 2">style="display:none"</if>/>
<input type="text" id="keyword2" name="keyword2" value="{$choose.keyword2}"  <empty name="choose.bything">style="display:none"</empty><if condition="$choose.bything eq 1">style="display:none"</if> onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onpaste="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" oncontextmenu = "value=value.replace(/[^\u4E00-\u9FA5]/g,'')" />
<input type="radio" class="r_btn" id="bything_defalut" name="bything" value="1" onclick="zhongwen_1();" <empty name="choose.bything">checked='checked'</empty> <if condition="$choose.bything eq 1">checked='checked'</if> />按 词
<input type="radio" class="r_btn" name="bything" value="2" onclick="zhongwen_2();" <if condition="$choose.bything eq 2">checked='checked'</if>  />按 字
<input type="checkbox" class="r_btn" id="all_key" name="all_key" value="1" <empty name="choose.all_key"><else /> checked='checked' </empty> />完全匹配
<input type="checkbox" class="r_btn" id="all_sql" name="all_sql" value="2" <empty name="choose.all_sql"><else /> checked='checked' </empty> />全库</p>
<p>结果定制：每页显示数目
<select id="count" name="count">
<option  value="10"  <if condition="$choose.count eq 10">selected='selected'</if>>10</option>
<option id="count_defalut" value="15" <empty name="choose.count"> selected='selected' <else />  </empty> <if condition="$choose.count eq 15">selected='selected'</if>>15</option>
<option value="20" <if condition="$choose.count eq 20">selected='selected'</if>>20</option>
</select>
<input type="radio" class="r_btn" id="orderby_default" name="orderby" value="1" <empty name="choose.orderby">checked='checked'</empty> <if condition="$choose.orderby eq 1">checked='checked'</if>/>时间倒序<input type="radio" class="r_btn" name="orderby" value="2" <if condition="$choose.orderby eq 2">checked='checked'</if>/>时间正序<input type="radio" class="r_btn" name="orderby" value="3" <if condition="$choose.orderby eq 3">checked='checked'</if>/>相关度</p>
<input type="hidden" id="submit" name="submit" value="1"/>
<p><input type="submit"  value="检 索" class="btn_r"/><input type="submit"  value="二次检索" class="btn_r" onclick="change_submit();" /><input type="button"  value="重 置" class="btn_r" onclick="byreset();"/></p>
</div>
<div class="upload"><input type="button" class="upload_bt" onclick="window.location.href='{:U('Book/upload')}'" /></div>

</form>
</div>
<div class="clear"></div>
<div class="content_r_bottom">
<ul>
<if condition="$statusx eq 1">
	<div style="margin:0 auto; width:240px;"><h3>对不起，没有符合要求的资源。</h3></div>
<else />
	<volist id="fl" name="booklist">
		<li class="imglist">
		<div class="crb_pic">
		
		<table>
		<tr>
		<td valign="middle">
		<div class="imgtd">
		<if condition="$fl.imageurl eq ''" >
		<a href="{:U('Book/info',array('vid'=>$fl['bid']))}"><img src="__PUBLIC__/Images/no_img.jpg" /></a>
		<else /> 
		<a href="{:U('Book/info',array('vid'=>$fl['bid']))}"><img src="__PUBLIC__/Uploads/Book/Image/m_{$fl.imageurl}" /></a>
		 </if>
		</div>
		</td>
		</tr>
		</table>
		</a>
		</div>
		<p><a href="{:U('Book/info',array('vid'=>$fl['bid']))}">{$fl.title|msubstr=0,8}</a><span>({$fl.point})</span></p>
		</li>
	</volist>
</if>
</ul>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="footer_num">
{$page}
</div>
</div>
<div class="clear"></div>
</div>
</div>

<div class="dialog popups">
<p class="ph1">文件下载</p>
<h4>{$hot.title}</h4>
<p class="needinfo">下载所需积分：<span class="integral">{$hot.downscore}</span></p>
<p class="restinfo">您所剩余积分：<span class="integral" id='prescore'>{$prescore}</span></p>
<div class="btn">
<form method='post' id='fom' action="{:U('Book/bookdownload')}" >
           <input type='hidden' name='title' value='{$hot.title}'/>
           <input type='hidden' name='url' value='{$hot.url}'/>
          <input type='hidden' name='score' value='{$hot.downscore}'/>
          <input type='hidden' name='code' value='{$hot.code}'/>
          <input type='hidden' name='bid' value='{$hot.bid}'/>
          <input type="button" value="立即下载" class="dbtn" id='down'  />
          <input type="button" value="取 消"  class="cbtn" id='cancel' onclick="disp('.dialog');"/>
          <input type='hidden' value='1' name='once' id='once'/>
          <input type='hidden' value='{$prescore}' name='prescore'/>
          <input type='hidden' value='1' name='count' id='count'/>
</form>
</div>
<p class="tips">如果您的积分不够，请及时<span><a href="{:U('Article/banquan',array('arid'=>4))}">联系管理员</a></span></p>
</div>


<div class="popups dialog_fail">
<p class="ph1">文件下载</p>
<h4>{$book.title}</h4>
<p class="needinfo">下载所需积分：<span class="integral">{$hot.downscore}</span></p>
<p class="restinfo">您所剩余积分：<span class="integral" id='prescore'>{$prescore}，不足以支付下载</span></p>
<div class="btn">
<input type="button" value="立即下载" class="nodbtn" id='free'/>
<input type="button" value="取 消"  class="cbtn" id='cancel' onclick="disp('.dialog_fail');"/>
</div>
<p class="tips">如果您的积分不够，请及时<span><a href="{:U('Article/banquan',array('arid'=>4))}">联系管理员</a></span></p>
</div>

<script type="text/javascript">
var k=0;
	function showctime()
	{
		$("#ctime").show();
	}

	function closectime()
	{
		$("#ctime").hide();
	}
	
	function select_fast_time()
	{
		$(":input[name='stime']").val(2);
		$("#stime1").attr("checked","");
		$("#stime2").attr("checked","true");
		$("#ctime").hide();
	}

	function change_keyword()
	{
		var zkeyword=$("#zkeyword").val();
		$("#keyword1").val(zkeyword);
		$("#keyword2").val(zkeyword);
	}

	function change_submit()
	{
		$("#submit").val(2);
	}

	function byreset()
	{
		//$.post("{:U('Search/reset')}",{},function(data){});
		$("#ftime_defalut").attr("selected","selected");
		$("#stime1").attr("checked","checked");
		$("#stime2").attr("checked","");
		$("#ctime").show();
		$("#zkeyword_defalut").attr("selected","selected");
		$("#count_defalut").attr("selected","selected");
		$("#btime").val('');
		$("#etime").val('');
		$("#keyword1").val('');
		$("#keyword2").val('');
		$("#bything_defalut").attr("checked","checked");
		$("#all_key").attr("checked","");
		$("#all_sql").attr("checked","");
		$("#orderby_default").attr("checked","checked");
	}

	function zhongwen_1()
	{
		$("#keyword2").hide();
		$("#keyword1").show();
	}
	
	function zhongwen_2()
	{
		$("#keyword1").hide();
		$("#keyword2").show();
	}

	function favorite()
	{
		var vid="{$hot.bid}";
		var type=7;
		var name="{$hot.title}";
		$.post("{:U('Book/favorite')}",{hotvid:vid,type:type,hotname:name},function (data){alert(data);} )
	}

	function disp(res){ 
		   $(res).hide();
	   }
	function point(a,b){
		   if(b>=a){
				 var left=($(window).width()-$('.dialog').width())/2;
				 var top=($(window).height()-$('.dialog').height())/2;
				 $('.dialog').fadeIn().css({'top':top,'left':left});
			}
			 if(b<a){
				 var left=($(window).width()-$('.dialog_fail').width())/2;
				 var top=($(window).height()-$('.dialog_fail').height())/2;
				 $('.dialog_fail').fadeIn().css({'top':top,'left':left});
			}
	   }
	    $('#but_no').click(function(){
	    	 window.location.href="{:U('User/login',array('type'=>'Book','vid'=>$hot['bid']))}";
	});
	    
	    $('#no_login').click(function(){
	    	 window.location.href="{:U('User/login',array('type'=>'Book','vid'=>$hot['bid']))}";
		});
var p=1;
	    $('#down').click(function(){
	          var vall=$('#once').val(); var valen=parseInt(vall)+1;
	          
	          var downlow="{$hot.downscore}"; var pre="{$prescore}";
		        	$("#once").attr("value",valen);
		        	var newval=parseInt(pre)-parseInt(downlow);
		        	 
		        	$("#prescore").html(newval);
			        $('.dialog').hide();
			        $('#count').val(k);
			        $('#once').val(p);
			        p+=1;
			        $('#fom').submit();
		 });
</script>
<include file="Public:footer" />
